<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateBalanceRecordTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('balance_record', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('order_num')->nullable()->comment('订单号');
            $table->bigInteger('user_id')->default(0)->comment('用户标识');
            $table->integer('type')->default(0)->comment('类型 0充值');
            $table->decimal('recharge_amount')->default(0)->comment('金额');
            $table->integer('status')->default(0)->comment('状态 0待支付 1已完成');
            $table->integer('is_pay')->default(0)->comment('是否支付 0未支付 1已支付');
            $table->string('pay_way')->nullable()->comment('支付方式 wechatpay微信支付');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('balance_record');
    }
}
